﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace School
{
    public partial class MyCenter : UserCheckPower
    {
        #region 传递参数
        /// <summary>
        /// ID
        /// </summary>
        public int ID
        {
            get
            {
                if (Request.QueryString["id"] == null || Request.QueryString["id"] == "")
                {
                    return 0;
                }
                return int.Parse(Request.QueryString["id"].ToString());
            }
        }
        #endregion
        BLL.Users Users = new BLL.Users();
        BLL.Classes Classes = new BLL.Classes();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (new BLL.Users().GetModel(LoginUserId).UserTypeID <= 3)
            {
                Panel p1 = (Panel)Master.FindControl("Panel1");
                Panel p2 = (Panel)Master.FindControl("Panel2");
                Panel p3 = (Panel)Master.FindControl("Panel3");
                Panel p4 = (Panel)Master.FindControl("Panel4");
                p1.CssClass = "sldmenuoff";
                p2.CssClass = "sldmenuon0";
                p3.CssClass = "sld1";
                p4.CssClass = "sld0";
                p3.Attributes.Add("style", "display: none");
                p4.Attributes.Add("style", "");
            }
            if (!IsPostBack)
            {
                Model.Users u = Users.GetModel(LoginUserId);
                if (u != null)
                {
                    lbName.Text = u.MemberName;
                    lbType.Text = new BLL.UserType().GetModel(int.Parse(u.UserTypeID.ToString())).TypeName;
                    Image1.ImageUrl = new BLL.UserPic().GetModel(int.Parse(u.Pic)).ImgURL;
                }
            }
        }
    }
}